export type Result<T = any> = {
  success: boolean;
  code: number;
  data: T;
  message: string;
  [key: string]: any;
};

export type PageType<T = any> = Result<T[]> & PageInfo<T>;

// getList 返回
// export interface PageType<T> extends Types<T> {}

// Omit<Result<T>, 'data'> & PageInfo<T>;

//分页数据类型
export type PageInfo<T> = {
  current: number;
  data: T[];
  total: number;
};

export type ResultPage<T> = Result<PageInfo<T>>;
//分页 getList接口返回
// export interface ResultPage<T> extends Result<PageInfo<T>> {
// }

export type ResultList<T> = Result<T[]>;
//列表
// export interface ResultList<T> extends Result<T[]> {
// }

export type ErrorType = {
  info: Result;
  name: string;
  message: string;
  stack: string;
};

export const BaseListUrl = {
  LIST: '/list',
  INSERT: '',
  UPDATE: '',
  DELETE: '',
  DETAIL: '',
  TREE_LIST: '/treeList',
};
